//
//  HomePageCell6.m
//  Mtime2.0
//
//  Created by 凉气的Mac on 16/9/6.
//  Copyright © 2016年 凉气的Mac. All rights reserved.
//

#import "HomePageCell6.h"

#import "HomePageModel.h"

#import <UIImageView+WebCache.h>

@implementation HomePageCell6



-(void)setupUI{

    [super setupUI];
    
    UILabel *titleCnLabel = [[UILabel alloc]init];
    
    self.titleCnLabel = titleCnLabel;
    
    [self.contentView addSubview:titleCnLabel];
    
    titleCnLabel.font = [UIFont systemFontOfSize:15];
    
    titleCnLabel.textColor = [UIColor colorWithWhite:0.800 alpha:1.000];
    
    //副标题
    [titleCnLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.right.equalTo(self.titleLable);
        
        make.top.equalTo(self.titleLable.mas_bottom).offset(5);
        
    }];
    
    //正文
    [self.commentLbel mas_remakeConstraints:^(MASConstraintMaker *make) {
        
        make.trailing.leading.equalTo(self.titleLable);
        
        make.top.equalTo(titleCnLabel.mas_bottom).offset(10);
        
    }];
    
    //图片
    [self.picture mas_updateConstraints:^(MASConstraintMaker *make) {
        
        make.height.equalTo(@120);

        make.width.equalTo(@80);
    }];
    
    //评分
    UILabel *ratingLabel = [[UILabel alloc]init];
    
    self.ratingLabel = ratingLabel;
    
    ratingLabel.font = [UIFont systemFontOfSize:14];
    
    [ratingLabel sizeToFit];
    
    ratingLabel.backgroundColor = [UIColor colorWithRed:0.275 green:0.657 blue:0.687 alpha:1.000];
    
    [self.picture addSubview:ratingLabel];
    
    [ratingLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.bottom.right.equalTo(self.picture);
        
        
    }];
    
    
    
    
}

-(void)setModel:(HomePageModel *)model{

    [super setModel:model];
    
     self.typeLabel.backgroundColor = [UIColor orangeColor];
    
    self.titleLable.text = model.titleCn;
    
    self.titleCnLabel.text = model.titleEn;
    
    [self.picture sd_setImageWithURL:[NSURL URLWithString:model.image]];
    
    self.ratingLabel.text = model.rating;
    
    self.timeLaber.text = @"";
    
    self.commentCountLabel.text = @"";
    
    
}




@end

































